package com.example.competitionregistration.controller;

import com.example.competitionregistration.common.Result;
import com.example.competitionregistration.controller.dto.UserDto;
import com.example.competitionregistration.service.LoginService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author QuanJingFang
 * @Description //TODO 登录控制层，接收客户端请求
 * @Date 2023/7/17 21:17
 **/
@RestController
@RequestMapping("/Login/")
public class LoginController {
    @Resource
    private LoginService loginService;

    /**
     * @Author QuanJingFang
     * @Description //TODO 学生登录控制层
     * @Date 2023/7/17 22:57
     * @Param [studentDto]
     * @return com.example.competitionregistration.entity.Result
     **/
    @PostMapping("/login")
    public Result login(@RequestBody UserDto userDto){
        return loginService.login(userDto);
    }

}
